<?php
/* [DoYouHaoBaby!] (C)Dianniu From 2010.
   this($)*/

!defined('DYHB_PATH') && exit;

class TemplateGtkGladeWidgetCompiler_GtkIconView extends TemplateGtkGladeWidgetCompilerBase{

	protected function compileCreateWidget_(TemplateGtkGladeWidget $oObject){
		$sWidgetClass=$oObject->getWidgetClass();
		$sVariableName='$'.TemplateGtkGlade::getWidgetVariableName($oObject);
		$sCompiled="\t\t{$sVariableName}=new {$sWidgetClass}();";
		$this->setStringInt_($oObject,$sCompiled,'pixbuf_column',false);// 像素缓冲(图标)列
		$this->setStringInt_($oObject,$sCompiled,'text_column',false);// 文字列
		$this->setStringInt_($oObject,$sCompiled,'markup_column',false);// 标记列
		$this->setStringInt_($oObject,$sCompiled,'selection_mode',false);// 选中模式
		$this->setStringInt_($oObject,$sCompiled,'orientation',false);// 排列方向
		$this->setStringInt_($oObject,$sCompiled,'columns',false);// 列数
		$this->setStringInt_($oObject,$sCompiled,'item_width',false);// 每项宽
		$this->setStringInt_($oObject,$sCompiled,'spacing',false);// 间隔
		$this->setStringInt_($oObject,$sCompiled,'row_spacing',false);// 行距
		$this->setStringInt_($oObject,$sCompiled,'column_spacing',false);// 列距
		$this->setStringInt_($oObject,$sCompiled,'margin',false);// 边距
		return $sCompiled;
	}

	protected function compileChildWidgetPacking_(TemplateGtkGladeWidget $oParentWidget,TemplateGtkGladeWidget $oChildWidget,TemplateGtkGladeWidgetPacking $oPacking){
		$sParentVariableName='$'.TemplateGtkGlade::getWidgetVariableName($oParentWidget);// 父/子 窗体变量名
		$sChildWidgetVariableName='$'.TemplateGtkGlade::getWidgetVariableName($oChildWidget);
		$sChildWidgetName=$oChildWidget->getWidgetId();// 子窗体名
		$sCompiled="\t\t{$sChildWidgetVariableName}=self::getWidget('{$sChildWidgetName}',\$arrObjectForSignal);";
		return $sCompiled;
	}

	static public function regToProcessorManager(ITemplateObjProcessorManager $oManager){
		$oManager->regProcessor(str_replace('TemplateGtkGladeWidgetCompiler_','',__CLASS__),__CLASS__);
	}

}
